#include <iostream>
#include <string>

#include <jsoncpp/json/json.h>

int main()
{
    int a = 10;
    int b = 20;

    char op = '+';

    Json::Value root;
    root["aa"] = a;
    root["bb"] = b;
    root["op"] = op;

    // Json::StyledWriter writer;
    Json::FastWriter writer;
    std::string s = writer.write(root);

    std::cout << s << std::endl;

    Json::Value _root;
    Json::Reader reader;
    reader.parse(s, _root);
    int _a = _root["aa"].asInt();
    int _b = _root["bb"].asInt();
    char _op = _root["op"].asInt();

    std::cout << _a << ' ' << _op << ' ' << _b << std::endl;

    return 0;
}